<?php
    $mytag_name = array();
    foreach ($details->tags as $tag)
        $mytag_name[] = $tag->name;


    if (!empty($mytag_name))
        $mytag_name = implode(', ', $mytag_name);
    else
        $mytag_name = "";


    $weekday = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
    $startDays = explode(',', $details->startWeekDayEN);
    $enableDays = array();

    foreach ($startDays as $day)
        $enableDays[] = array_search($day, $weekday);
?>

<script type="text/javascript">

    var enableDays = new Array();

<?php foreach ($enableDays as $day): ?>
            enableDays.push(<?= $day ?>);
    <?php endforeach; ?>

</script>

<div id="" class="content">

    <div class="pull-right sociallinks">

        <!-- AddThis Button BEGIN -->
        <ul class="addthis_toolbox addthis_default_style">
            <li>
                <a class="addthis_button_tweet"></a>
            </li>
            <li>
                <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
            </li>
            <li>
                <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
            </li>
            <li>
                <a class="addthis_counter addthis_pill_style"></a>
            </li>

        </ul>
        <!-- AddThis Button END -->

    </div>

    <h1><?= $h1_title ?></h1>

    <div class="holder clearfix">

        <div class="clearfix mask-height">

            <div class="pull-right details">



                <div class="detailbox">
                    <dl class="clearfix">

                        <dt><?= lang('exc_category') ?></dt>
                        <dd><div class="tag-icon"></div><?= $mytag_name ?></dd>

                        <dt><?= lang('guides') ?></dt>
                        <dd><?= implode(', ', explode(',', $details->guides)) ?></dd>

                        <dt><?= lang('start_day') ?></dt>
                        <dd><?= implode(', ', explode(',', $details->startWeekDay)) ?></dd>

                        <dt><?= lang('addition') ?></dt>
                        <dd><?= $details->addition == "" ? "&nbsp;" : $details->addition ?></dd>

                        <dt><?= lang('transportation_type') ?></dt>
                        <dd><?= $details->transports_title ?></dd>

                        <dt><?= lang('pickup_location') ?></dt>
                        <dd><?= implode(', ', explode(',', $details->pickup_location)) ?></dd>

                        <dt><?= lang('description') ?></dt>
                        <dd><?= $details->description == "" ? "&nbsp;" : $details->description ?></dd>

                        <dt><?= lang('sellingSeason') ?></dt>
                        <dd><?= '<strong>' . date('d.M', $details->season_start) . ' - ' . date('d.M', $details->season_end) . '</strong>.'; ?></dd>



                    </dl>

                </div>

                <div class="clearfix" id="scrool_to_price">
                    <div class="form_prices pull-left calculation2 calculation">
                        <div class="inner_prices">

                            <ul>
                                <li class="personas"><?= lang('dtl.num_of_persons'); ?>: <span class="service_persons"><?= lang('dtl.adults'); ?>: <?= $details->form->adl ?>, <?= lang('dtl.children'); ?>: <?= $details->form->chd ?></span></li>
                                <li class="periodes"><?= lang('start_day'); ?>: <span class="service_periods"><?= $details->form->firstAvailableDay ?>, <?= $details->form->firstAvailableDayText ?></span></li>
                                <li><?= $details->name ?>: <span class="service_total"><?= $details->form->service_price ?> </span> &euro; / <?= lang('res.person'); ?></li>
                                <li class="total clearfix"><b><?= lang('total'); ?>   : <span><?= $details->form->total_price ?></span> &euro;</b> <input type="button" class="booknow check_available123 request" value="<?= lang('res.send_request'); ?>" id="book_now_input"></li>

                            </ul>

                            <div class="too_many"></div>

                        </div>
                    </div>
                </div><!--calculation-->



            </div>

            <div class="pull-left results-holder">

                <div class="pikachoose">

                    <!--Fake responsive image--> 
                    <div class="gallery_img">
                        <img src="<?= HOST_URL_HOTELS . $details->photo_path . '/thumb_500x304/' . $details->photo_name; ?>" alt="<?= $details->name ?>">
                    </div> 

                    <ul id="pikame" class="jcarousel-skin-pika">

                        <?php
                            foreach ($details->photos as $photo):
                                $thumbnail = HOST_URL_HOTELS . $details->photo_path . '/thumb_500x304/' . $photo->filename;
                                ?>    
                                <li><img src="<?= $thumbnail ?>" alt="<?= $photo->title ?>" style="display: none"></li>
                            <?php endforeach; ?>

                    </ul><!-- Main Pica Gallery -->

                </div>

            </div>

        </div>

    </div>

</div>



<div class="content" id="tabs">

    <div id="tabvanilla" class="widget">

        <ul class="tabnav">
            <li><a href="#information_tab"><?= lang('dtl.information'); ?></a></li>
            <li><a href="#prices_tab"><?= lang('dtl.prices_availability'); ?></a></li>
            <li><a href="#question"><?= lang('dtl.question'); ?>?</a></li>
        </ul>

        <div id="information_tab" class="tabdiv ">

            <?php if (isset($details->excursion_text) && $details->excursion_text != ""): ?>
                    <h3 class="exc_info_name"><?= $details->name ?></h3>
                    
                    <?= lang('sellingSeason') . '<strong>' . date('d.M', $details->season_start) . ' - ' . date('d.M', $details->season_end) . '</strong>.'; ?>
                    
                    <div class="info">
                        <?= $details->excursion_text ?>
                    </div>
                    <br>

                <?php endif; ?>

            <br>
            <div class = "description" id="accommodation-body">

                <?php if (count($similar) > 1): ?>

                        <h4><?= lang('exc_similar') ?>:</h4>

                    <?php endif; ?>


                <div class="rooms">
                    <?php
                        $cnt = count($similar);
                        for ($i = 0; $i < $cnt; $i++):

                            $exc_name = URLify::filter($similar[$i]->name);
                            $href = lang_url('excursions/' . $exc_name . '-' . $similar[$i]->ID);
                            $thumbnail = HOST_URL_HOTELS . $similar[$i]->photo_path . '/thumb_88x88/' . $similar[$i]->photo_name;
                            $preview = HOST_URL_HOTELS . $similar[$i]->photo_path . '/thumb_300x178/' . $similar[$i]->photo_name;

                            $mytag_name = array();
                            $mytag_id = array();
                            foreach ($similar[$i]->tags as $tag):
                                $mytag_name[] = $tag->name;
                                $mytag_id[] = $tag->ID;
                            endforeach;


                            if (!empty($mytag_name)):
                                $mytag_name = implode(', ', $mytag_name);
                                $mytag_id = implode(',', $mytag_id);

                            else:
                                $mytag_name = "";
                                $mytag_id = "";

                            endif;
                            ?>

                            <div class="other_rooms clearfix">

                                <div class="table-holder">
                                    <a href="<?= $href ?>" class="slika">
                                        <img src="<?= $thumbnail ?>" alt="<?= $similar[$i]->photo_name ?>">
                                    </a>
                                    <table class="table table-condensed table-hover rooms">
                                        <tbody>
                                            <tr>
                                                <th><?= lang('exc.excursion') ?></th>
                                                <th><?= lang('exc_category') ?></th>
                                                <th><?= lang('price'); ?></th>
                                            </tr>

                                            <tr>
                                                <td><a href="<?= $href ?>"><?= $similar[$i]->name ?></a></td>
                                                <td class="gray"><?= $mytag_name ?></td>
                                                <td class="price"> <?= $similar[$i]->adultPrice ?> &euro; <span>/ <?= lang('per_person'); ?></span></td>
                                            </tr>


                                        </tbody>
                                    </table>
                                </div>

                            </div>

                        <?php endfor; ?>
                </div>


                <br>
                <br>

            </div>

        </div><!--/information_tab-->


        <div id = "prices_tab" class = "tabdiv clearfix" style="display: none">

            <div class="pull-right polices">

                <h4><?= lang('note') ?></h4>

                <?= lang('sellingSeason') . '<strong>' . date('d.M', $details->season_start) . ' - ' . date('d.M', $details->season_end) . '</strong>.'; ?>

            </div>

            <div class="pull-left oneborder">

                <form class="form-horizontal" id="prices_form" action="<?= lang_url('excursions/reservation') ?>" method="get">

                    <input type="hidden" name="exc_id" id="exc_id" value="<?= $details->ID ?>">

                    <?php
                        $this->load->view('parts/pricesformExcursions')
                    ?>

                    <div class="clearfix">
                        <div class="hold_booknow">
                            <input type="submit" value="<?= lang('res.send_request'); ?>" class="booknow request" id="book_now_input_default">  
                        </div>
                    </div>

                </form>

            </div>


        </div><!--/prices_tab-->

        <div id="question" class="tabdiv clearfix"  style="display: none">

            <form id="question_form">
                <input type="hidden" name="from_page" value="Excursion <?= $details->name ?>">
                <fieldset>
                    <legend><?= lang('dtl.question'); ?>?</legend>

                    <p></p>
                    <p class="help-block"><?= lang('dtl.question_text_clean'); ?></p>

                    <div class="pull-left col-1">

                        <label><?= lang('name'); ?>:</label>
                        <input type="text" placeholder="<?= lang('name') ?>" name='name' id='name' required>

                        <label><?= lang('surname'); ?>:</label>
                        <input type="text" placeholder="<?= lang('surname') ?>" name='surname' id='surname' required>

                        <label><?= lang('country'); ?>:</label>
                        <select placeholder="<?= lang('country'); ?>" name="country" id="country" required>
                            <option value=""><?= lang('country'); ?></option>
                            <?
                            foreach (config_item('country_list') as $key => $country)
                            echo "<option value='{$country}'>{$country}</option>";
                            ?>
                        </select>

                        <label><?= lang('email'); ?>:</label>
                        <input type="email" placeholder="<?= lang('email') ?>"  name='email' id='email' required>

                        <label><?= lang('mobile_phone'); ?>:</label>
                        <input type="text" placeholder="<?= lang('mobile_phone') ?>"  name='mobile_phone' id='mobile_phone' required>

                        <label class="checkbox">
                            <input type="checkbox" checked="checked" value='1' name='newsletter'><span class="help-block"><?= lang('newsletter'); ?></span>
                        </label>

                    </div>
                    <div class="pull-left col-2">

                        <label><?= lang('note'); ?>:</label>
                        <textarea cols="33" rows="8" name='note' id='note' required></textarea>

                        <button type="submit" class="button-home"><?= lang('send'); ?></button>

                    </div>
                </fieldset>
            </form>
            <br>

        </div><!--question_tab-->

    </div>



</div>

<?php $this->load->view('parts/subscripbe') ?>